package com.aqie.security.demo.response;

/**
 * @Function:
 * @Author: aqie
 * @Date: 2019/4/5 11:45
 */
public class CodeMsg {
    private int code;
    private String msg;


    private CodeMsg() {}

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }


    public CodeMsg(String msg) {
        this.msg = msg;
    }

    public CodeMsg(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public CodeMsg fillArgs(Object... args) {
        int code = this.code;
        String message = String.format(this.msg, args);
        return new CodeMsg(code, message);
    }

}
